package edu.cqie.smartfarm.dto;

import edu.cqie.smartfarm.verify.anno.Phone;
import edu.cqie.smartfarm.verify.anno.Status;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
@ApiModel(value = "用户DTO对象", description = "用户DTO对象")
public class UserDTO extends PageDTO{
    @ApiModelProperty(value = "用户id，Long类型，表示用户在数据库中的唯一标识，非空")
    private Long userId;

    @ApiModelProperty(value = "登录密码")
    //@NotNull(message = "登录密码必填")
    private String password;

    @ApiModelProperty(value = "人员姓名，字符串类型，表示系统用户的全名，非空")
    @NotNull(message = "人员姓名必填")
    @NotEmpty(message = "人员姓名不能为空")
    @Length(max = 10, message = "人员姓名长度不能超过10")
    private String name;

    @ApiModelProperty(value = "手机号，字符串类型，允许NULL，用于联系用户")
    @NotEmpty(message = "手机号必填")
    @Phone
    private String phone;

    @ApiModelProperty(value = "状态，布尔值（0或1），1代表启用，0代表停用，默认为启用状态")
    @NotNull(message = "状态必填")
    @Status
    private Integer status;
}
